#!/usr/bin/env bash


url="http://123.206.210.251:12000/job/hack"

build="curl ${url}/build?token=47Ze5sa62KcQANvJopxhB32f9Hyhc9znWS5yVqkF8JmmNyK4PvLud96jFJrfTzJYfhfKhz4VSNZZ8Y8VkRpns4i1UA8K4te"
log="curl -s  ${url}/lastBuild/consoleText"

eval $build

set i=0
set j=0
for((i=0;i<10;))
do
        let "j=j+1"
        sleep 3
        eval $log
        res=`eval $log`
        [[ $res =~ "Finished: SUCCESS" ]] && echo "打包完成" && break
        [[ $res =~ "Finished: FAILURE" ]] && echo "打包失败" && break
done